package com.albaba.designpattern.strategy.text_002;

import java.util.Collection;
import java.util.List;

/**
 * @Description: TODO
 * @Author zx
 * @Date 2025/2/24 18:08
 * @Version 1.0
 */
public class Client {

    public static void main(String[] args) {
        List<Receipt> receiptList = ReceiptBuilder.getReceiptList();
        for (Receipt receipt : receiptList) {
            if ("MT1101".equals(receipt.getType())) {
                System.out.println("接收到MT1101的回执信息：" + receipt.getMessage());
                System.out.println("解析回执内容");
                System.out.println("执行业务逻辑A");
            } else if ("MT2101".equals(receipt.getType())) {
                System.out.println("接收到MT2101的回执信息：" + receipt.getMessage());
                System.out.println("解析回执内容");
                System.out.println("执行业务逻辑B");
            } else if ("MT4101".equals(receipt.getType())) {
                System.out.println("接收到MT4101的回执信息：" + receipt.getMessage());
                System.out.println("解析回执内容");
                System.out.println("执行业务逻辑C");
            }else if ("MT8104".equals(receipt.getType())){
                System.out.println("接收到MT8104的回执信息：" + receipt.getMessage());
                System.out.println("解析回执内容");
                System.out.println("执行业务逻辑D");
            }
        }
    }
}
